package com.leyou.service;

import com.leyou.mapper.JiluMapper;
import com.leyou.mapper.LogMapper;
import com.leyou.pojo.Jilu;
import com.leyou.pojo.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TestService {

    @Autowired
    private LogMapper logMapper;

    @Autowired
    private JiluMapper jiluMapper;

    @Transactional
    public void test(){
        Log log = new Log();
        //log.setOrderid(222424l);
        log.setSkuid(21423423l);
        logMapper.insert(log);

        Jilu j = new Jilu();
        j.setId(123l);
        j.setSerialno(1111111111l);

        jiluMapper.updateByPrimaryKey(j);
        try {
            Thread.sleep(30000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
